package com.lzl.servicedriveruser.generator;

/**
 * //TODO
 *
 * @author zhaolinlin
 * @description //TODO
 * @createTime 2022/8/30 20:54
 */

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.util.Collections;

/**
 * 自动生成代码工具类
 */
public class MysqlGenerator {

    public static void main(String[] args) {

        FastAutoGenerator.create("jdbc:mysql://127.0.0.1:3306/service-driver-user?useUnicode=true&characterEncodeing=UTF-8&useSSL=false&serverTimezone=GMT",
                "root", "123456")
                .globalConfig(builder -> {
                    builder.author("lzl").fileOverride().outputDir("E:\\project\\online-taxi\\online-taxi-lzl\\service-driver-user\\src\\main\\java");
                })
                .packageConfig(builder -> {
                    builder.parent("com.lzl.servicedriveruser").pathInfo(Collections.singletonMap(OutputFile.mapperXml,
                            "E:\\project\\online-taxi\\online-taxi-lzl\\service-driver-user\\src\\main\\java\\com\\lzl\\servicedriveruser\\mapper"));
                })
                .strategyConfig(builder -> {
                    builder.addInclude("driver_car_binding_relationship");

                })
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }
}
